﻿''' <summary>
''' 
''' </summary>
''' <remarks></remarks>
Public Class ChangeNotificationEventArgs
    Inherits EventArgs
    Implements IEnumerable(Of String)

    Private _changeid As String
    Private _dictionary As New Dictionary(Of String, Object)
    Private _keys As New List(Of String)

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Sub New(ByVal changeid As String)
        Me._changeid = changeid
    End Sub

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public ReadOnly Property ChangeID As String
        Get
            Return _changeid
        End Get
    End Property

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public ReadOnly Property Item(ByVal key As String) As Object
        Get
            Try
                Return _dictionary(key)
            Catch ex As Exception
                Return Nothing
            End Try
        End Get
    End Property

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub Push(ByVal key As String, ByVal ParamArray value() As Double)
        InternalPush(key, value)

    End Sub
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub Push(ByVal key As String, ByVal ParamArray value() As Single)
        InternalPush(key, value)

    End Sub
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub Push(ByVal key As String, ByVal ParamArray value() As Integer)

    End Sub
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub Push(ByVal key As String, ByVal ParamArray value() As Long)
        InternalPush(key, value)

    End Sub
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub Push(ByVal key As String, ByVal ParamArray value() As String)

    End Sub
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub Push(ByVal key As String, ByVal ParamArray value() As Boolean)
        InternalPush(key, value)

    End Sub
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub Push(ByVal key As String, ByVal ParamArray value() As DateTime)
        InternalPush(key, value)
    End Sub

    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Private Sub InternalPush(ByVal key As String, ByVal value As Object)
        If _dictionary.ContainsKey(key) Then
            _dictionary(key) = value
        Else
            _dictionary.Add(key, value)
            _keys.Add(key)
        End If
    End Sub
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Private Function GetEnumerator() As System.Collections.Generic.IEnumerator(Of String) Implements System.Collections.Generic.IEnumerable(Of String).GetEnumerator
        Return _keys.GetEnumerator()
    End Function
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <remarks></remarks>
    Private Function GetEnumerator1() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
        Return _keys.GetEnumerator()
    End Function
End Class
